package top.mcwebsite.playandroid.lib.task

object TaskManager {

    private var debug: Boolean = false

    private var dispatcher: TaskDispatcher = DefaultTaskDispatcher()

    fun debug(enable: Boolean) {
        this.debug = enable
    }

    fun isDebug() = debug

    fun setTaskDispatcher(taskDispatcher: TaskDispatcher) {
        this.dispatcher = taskDispatcher
    }

    fun getTaskDispatcher() = dispatcher

    /**
     * 自动生成一个 Task name
     */
    fun generatedTaskName() = Utils.generatedTaskName()


    fun newTaskChain(): TaskChain {
        return TaskChain()
    }
}